Romberg's Method
   HOME

TheInfoList



OR:

In
numerical analysis Numerical analysis is the study of algorithms that use numerical approximation (as opposed to symbolic computation, symbolic manipulations) for the problems of mathematical analysis (as distinguished from discrete mathematics). It is the study of ...
, Romberg's method is used to estimate the
definite integral In mathematics, an integral assigns numbers to functions in a way that describes displacement, area, volume, and other concepts that arise by combining infinitesimal data. The process of finding integrals is called integration. Along with di ...
\int_a^b f(x) \, dx by applying
Richardson extrapolation In numerical analysis, Richardson extrapolation is a sequence acceleration method used to improve the rate of convergence of a sequence of estimates of some value A^\ast = \lim_ A(h). In essence, given the value of A(h) for several values of h, we ...
repeatedly on the
trapezium rule In calculus, the trapezoidal rule (also known as the trapezoid rule or trapezium rule; see Trapezoid for more information on terminology) is a technique for approximating the definite integral. \int_a^b f(x) \, dx. The trapezoidal rule works by ...
or the
rectangle rule In mathematics, a Riemann sum is a certain kind of approximation of an integral by a finite sum. It is named after nineteenth century German mathematician Bernhard Riemann. One very common application is approximating the area of functions or ...
(midpoint rule). The estimates generate a
triangular array In mathematics and computing, a triangular array of numbers, polynomials, or the like, is a doubly indexed sequence in which each row is only as long as the row's own index. That is, the ''i''th row contains only ''i'' elements. Examples Notable ...
. Romberg's method is a Newton–Cotes formula – it evaluates the integrand at equally spaced points. The integrand must have continuous derivatives, though fairly good results may be obtained if only a few derivatives exist. If it is possible to evaluate the integrand at unequally spaced points, then other methods such as
Gaussian quadrature In numerical analysis, a quadrature rule is an approximation of the definite integral of a function, usually stated as a weighted sum of function values at specified points within the domain of integration. (See numerical integration for mor ...
and
Clenshaw–Curtis quadrature Clenshaw–Curtis quadrature and Fejér quadrature are methods for numerical integration, or "quadrature", that are based on an expansion of the integrand in terms of Chebyshev polynomials. Equivalently, they employ a change of variables x = \cos ...
are generally more accurate. The method is named after Werner Romberg (1909–2003), who published the method in 1955.


Method

Using h_n = \frac, the method can be inductively defined by \begin R(0,0) &= h_1 (f(a) + f(b)) \\ R(n,0) &= \tfrac R(n-1,0) + h_n \sum_^ f(a + (2k-1)h_n) \\ R(n,m) &= R(n,m-1) + \tfrac (R(n,m-1) - R(n-1,m-1)) \\ &= \frac ( 4^m R(n,m-1) - R(n-1, m-1)) \end where n \ge m and m \ge 1 \, . In
big O notation Big ''O'' notation is a mathematical notation that describes the limiting behavior of a function when the argument tends towards a particular value or infinity. Big O is a member of a family of notations invented by Paul Bachmann, Edmund Lan ...
, the error for ''R''(''n'', ''m'') is: O\left(h_n^\right). The zeroeth extrapolation, , is equivalent to the
trapezoidal rule In calculus, the trapezoidal rule (also known as the trapezoid rule or trapezium rule; see Trapezoid for more information on terminology) is a technique for approximating the definite integral. \int_a^b f(x) \, dx. The trapezoidal rule works b ...
with points; the first extrapolation, , is equivalent to
Simpson's rule In numerical integration, Simpson's rules are several approximations for definite integrals, named after Thomas Simpson (1710–1761). The most basic of these rules, called Simpson's 1/3 rule, or just Simpson's rule, reads \int_a^b f(x) \, ...
with points. The second extrapolation, , is equivalent to
Boole's rule In mathematics, Boole's rule, named after George Boole, is a method of numerical integration. Formula Simple Boole's Rule It approximates an integral: : \int_^ f(x)\,dx by using the values of at five equally spaced points: : \begin & x_0 ...
with points. The further extrapolations differ from Newton-Cotes formulas. In particular further Romberg extrapolations expand on Boole's rule in very slight ways, modifying weights into ratios similar as in Boole's rule. In contrast, further Newton-Cotes methods produce increasingly differing weights, eventually leading to large positive and negative weights. This is indicative of how large degree interpolating polynomial Newton-Cotes methods fail to converge for many integrals, while Romberg integration is more stable. By labelling our O(h^2) approximations as A_0\big(\frac\big) instead of R(n,0), we can perform Richardson extrapolation with the error formula defined below: \int_a^b f(x) \, dx = A_0\bigg(\frac\bigg)+a_0\bigg(\frac\bigg)^ + a_1\bigg(\frac\bigg)^ + a_2\bigg(\frac\bigg)^ + \cdots Once we have obtained our O(h^) approximations A_m\big(\frac\big), we can label them as R(n,m). When function evaluations are expensive, it may be preferable to replace the polynomial interpolation of Richardson with the rational interpolation proposed by .


A geometric example

To estimate the area under a curve the trapezoid rule is applied first to one-piece, then two, then four, and so on. After trapezoid rule estimates are obtained,
Richardson extrapolation In numerical analysis, Richardson extrapolation is a sequence acceleration method used to improve the rate of convergence of a sequence of estimates of some value A^\ast = \lim_ A(h). In essence, given the value of A(h) for several values of h, we ...
is applied. *For the first iteration the two piece and one piece estimates are used in the formula The same formula is then used to compare the four piece and the two piece estimate, and likewise for the higher estimates *For the second iteration the values of the first iteration are used in the formula *The third iteration uses the next power of 4: on the values derived by the second iteration. *The pattern is continued until there is one estimate. *MA stands for more accurate, LA stands for less accurate


Example

As an example, the
Gaussian function In mathematics, a Gaussian function, often simply referred to as a Gaussian, is a function of the base form f(x) = \exp (-x^2) and with parametric extension f(x) = a \exp\left( -\frac \right) for arbitrary real constants , and non-zero . It is n ...
is integrated from 0 to 1, i.e. the
error function In mathematics, the error function (also called the Gauss error function), often denoted by , is a complex function of a complex variable defined as: :\operatorname z = \frac\int_0^z e^\,\mathrm dt. This integral is a special (non-elementary ...
erf(1) ≈ 0.842700792949715. The triangular array is calculated row by row and calculation is terminated if the two last entries in the last row differ less than 10−8. 0.77174333 0.82526296 0.84310283 0.83836778 0.84273605 0.84271160 0.84161922 0.84270304 0.84270083 0.84270066 0.84243051 0.84270093 0.84270079 0.84270079 0.84270079 The result in the lower right corner of the triangular array is accurate to the digits shown. It is remarkable that this result is derived from the less accurate approximations obtained by the trapezium rule in the first column of the triangular array.


Implementation

Here is an example of a computer implementation of the Romberg method (in the
C programming language ''The C Programming Language'' (sometimes termed ''K&R'', after its authors' initials) is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the language, as well as ...
): #include #include void print_row(size_t i, double *R) /* INPUT: (*f) : pointer to the function to be integrated a : lower limit b : upper limit max_steps: maximum steps of the procedure acc : desired accuracy OUTPUT: Rp ax_steps-1 approximate value of the integral of the function f for x in ,bwith accuracy 'acc' and steps 'max_steps'. */ double romberg(double (*f)(double), double a, double b, size_t max_steps, double acc) Here is an example of a computer implementation of the Romberg method in the
Javascript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
programming language. /** * INPUTS * func = integrand, function to be integrated * a = lower limit of integration * b = upper limit of integration * nmax = number of partitions, n=2^nmax * tol_ae = maximum absolute approximate error acceptable (should be >=0) * tol_rae = maximum absolute relative approximate error acceptable (should be >=0) * OUTPUTS * integ_value = estimated value of integral */ function auto_integrator_trap_romb_hnm(func, a, b, nmax, tol_ae, tol_rae)


References

* * * * * * * {{Citation , last1=Press, first1=WH , last2=Teukolsky, first2=SA , last3=Vetterling, first3=WT , last4=Flannery, first4=BP , year=2007 , title=Numerical Recipes: The Art of Scientific Computing, edition=3rd , publisher=Cambridge University Press, publication-place=New York, isbn=978-0-521-88068-8 , chapter=Section 4.3. Romberg Integration, chapter-url=http://apps.nrbook.com/empanel/index.html?pg=166


External links


ROMBINT
– code for
MATLAB MATLAB (an abbreviation of "MATrix LABoratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementation ...
(author: Martin Kacenak)
Free online integration tool using Romberg, Fox–Romberg, Gauss–Legendre and other numerical methods
Numerical integration (quadrature) Articles with example C code